const app=getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    saleId:'',
    commu:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that=this,id=options.id;
    that.setData({
      saleId:id
    });
    wx.request({
      url: app.buildUrl('/complaint/get-detail-sale'),
      header: app.buildHeader(),
      method: 'GET',
      data: {
        id: id
      },
      success: res => {
        let data = res.data.data;
        app.transformTime(data.complete_time * 1000, (options) => {
          data.complete_time = `${options.Y}-${options.M}-${options.D} ${options.h}:${options.m}:${options.s}`;
        })
        app.transformTime(data.create_time * 1000, (options) => {
          data.create_time = `${options.Y}-${options.M}-${options.D} ${options.h}:${options.m}:${options.s}`;
        })
        app.transformTime(data.update_time * 1000, (options) => {
          data.update_time = `${options.Y}-${options.M}-${options.D} ${options.h}:${options.m}:${options.s}`;
        })
        that.setData({
          commu: res.data.data
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  }
})